﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucUploadImage.ascx.cs"
    Inherits="en_ucControl_ucUploadImage" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %>

<script type="text/javascript">
    function ValidateChecked(sender, args) {
        if ($('#<%= chkAccept.ClientID %>').attr('checked')) {
            $('#tdCheckboxAgree').removeClass("checkReq");
        }
        else {
            $('#tdCheckboxAgree').removeClass("checkReq");
            $('#tdCheckboxAgree').addClass("checkReq");
            args.IsValid = false;
        }
    }    
</script>

<style type="text/css">
    .checkReq
    {
        border: solid 1px black;
        background-color: #C52021;
    }
</style>
<div id="content_center">
    <div class="content_center_padding">
        <div class="content_center_padding">
            <table>
                <tr>
                    <td>
                        <h1>
                            Upload Photos</h1>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p>
                            Browse an image</p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="f_name" runat="server" Width="250px" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*"
                            ControlToValidate="f_name" ValidationGroup="UploadImage"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lb_message" runat="server" Style="color: Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:UpdatePanel ID="updCap" runat="server">
                            <ContentTemplate>
                                <cc1:CaptchaControl ID="msCaptcha" runat="server" BorderWidth="1px" BorderStyle="Solid"
                                    BorderColor="#5daeff" Width="185" FontColor="#007eb3" ForeColor="AliceBlue" NoiseColor="#237ceb"
                                    CaptchaBackgroundNoise="Extreme" CaptchaLength="5" CaptchaHeight="50" CaptchaWidth="185"
                                    CaptchaLineNoise="None" CaptchaMinTimeout="5" CaptchaMaxTimeout="240" LineColor="Yellow"
                                    CaptchaFontWarping="Low" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:LinkButton ID="lnkRefreshCaptcha" runat="server" Text="Reload Verification code:"
                            CausesValidation="false" Style="font-size: 12px;" OnClick="lnkRefreshCaptcha_Click"></asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td valign="top" style="padding-left: 5px;">
                        <asp:Label ID="lblInputCaptcha" runat="server" Text=" Verification code:" Style="font-size: 12px;"></asp:Label>
                        <asp:UpdatePanel ID="updTxt" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCaptcha" runat="server" Width="100" CssClass="txtRegisterReq"
                                    autocomplete="off" ToolTip="Mã xác minh"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                        ID="regCaptcha" runat="server" ErrorMessage="" ToolTip="Input Captcha." ForeColor="Red"
                                        ControlToValidate="txtCaptcha" SetFocusOnError="true" Text="*" ValidationGroup="UploadImage"></asp:RequiredFieldValidator></ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lnkRefreshCaptcha" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                        
                    </td>
                </tr>
                <tr>
                    <td id="tdCheckboxAgree" class="loginLnk">
                        <asp:CheckBox ID="chkAccept" runat="server" />
                        I have read and accepted with <a href="#">terms of us.</a><br />
                        <div style="padding: 0 0 0 23px;">
                            All violation images will be removed from server.</div>
                        <asp:CustomValidator ClientValidationFunction="ValidateChecked" runat="server" ID="valchkAccept"
                            ValidationGroup="UploadImage" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="padding_center">
                            <asp:Button ID="btnUpload" runat="server" CssClass="button" Text="Upload Image" ValidationGroup="UploadImage"
                                OnClick="btnUpload_Click" />
                        </div>
                        <div style="float: left; padding: 20px 0;">
                            <h4>
                                Note</h4>
                            <p style="font-weight: normal; color: #2e2e2e; margin: 5px;">
                                - Png, Gif, Jpg, Jpeg format will be allowed.<br />
                                - Maximum file allow: 1024 KB</p>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<div id="content_right">
    <div class="right_content">
        <p class="font_weight">
            <label style="color: #27ae07;">
                Photos group name:</label>
            <asp:Label ID="lblAlbumName" Text="#N/A" runat="server"></asp:Label></p>
        <p class="padding_center">
            <%--<a class="button_bt" href="#">Get photos group code</a>--%>
            <asp:HyperLink ID="hypGetPhotoGroup" runat="server" CssClass="thickbox" ToolTip="Get Code Image"><div class="button_bt">
                                    <span style="color:White">Get photos group code</span></div></asp:HyperLink>
        </p>
        <div class="right_items">
            <div class="right_img">
                <asp:Repeater ID="reImageByAlbum" runat="server">
                    <ItemTemplate>
                        <div class="right_img">
                            <%--<img src="images/img.jpg" />--%>
                            <asp:HyperLink ID="imgImage" runat="server" NavigateUrl='<%# "~/Admin/img/images/"+Eval("ImageURL") %>'
                                rel="example_group">
                                <asp:Image ID="imageAl" runat="server" Style="width: 95px; height: 65px" ImageUrl='<%#"~/Admin/img/images/"+Eval("ImageURL") %>' />
                            </asp:HyperLink>
                            <%--<a href="#">
                                <div class="button_right">
                                    Get Code</div>
                            </a>--%>
                            <asp:HyperLink ID="hyEdithtml" runat="server" NavigateUrl='<%#"~/en/GetCodeImage.aspx?IdImg=" + Eval("IDImage") + "&keepThis=true&TB_iframe=true&width=700&height=100&ico=images/Get.png" %>'
                                CssClass="thickbox" ToolTip="Get Code Image"><div class="button_right">
                                    Get Code</div></asp:HyperLink>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
    </div>
</div>
